// pages/service/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    workOrderMenus: [
      { name: '工单报障', url: '../../images/server_yi_gong.png',handle:'handleAddWork',status:'' },
      { name: '全部工单', url: '../../images/server_yi_all.png',handle:'handleWork',status:'' },
      { name: '我的工单', url: '../../images/server_yi_main.png',handle:'handleMyWork',status:'' },
      { name: '工单统计', url: '../../images/server_yi_tong.png',handle:'handleTj',status:'' }
    ],
    knowledgeMenus: [
      { name: '知识库', url: '../../images/server_zhi_zhi.png',to:'../../package_server/pages/eassy/index' },
      { name: '知识统计', url: '../../images/server_zhi_tong.png' }
    ],
    statsMenus: [
      { name: '全部考核', url: '../../images/server_tong_all.png' },
      { name: '分类统计', url: '../../images/server_tong_category.png' },
      { name: '成果统计', url: '../../images/server_tong_out.png' }
    ],
    showTaskPicker: false
  },
  navigateTo(ev){
    let {name} = ev.currentTarget.dataset;
    if(name==='知识库'){
      wx.navigateTo({
        url: '../../package_server/pages/eassy/index',
      })
    }
  },
  handleAddWork(){
    this.setData({ showTaskPicker: true });
  },
  onTaskPickerConfirm(e) {
    console.log('选择了:', e.detail.value);
    let status=e.detail.value
    wx.navigateTo({
      url: `/package_work/pages/addWork/index?`+`status=${status}`,
    })
    // 处理选择结果
  },

  onTaskPickerCancel() {
    console.log('用户取消了选择');
  },
 handleWork(ev){
  let status=ev.currentTarget.dataset.status
      wx.navigateTo({
        url: `../../package_work/pages/allWork/index?`+`status=${status}`,
      })
},
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

})